package com.example.flowlayoutdemo1

import android.os.Bundle
import com.google.android.material.snackbar.Snackbar
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.navigateUp
import androidx.navigation.ui.setupActionBarWithNavController
import com.example.flowlayoutdemo1.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

    private lateinit var binding: ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)
        initView()
    }

    private fun initView() {
        val data: MutableList<String> = arrayListOf()
        data.add("键盘")
        data.add("显示器")
        data.add("鼠标")
        data.add("iPad")
        data.add("air pod")
        data.add("Android 手机")
        data.add("map pro")
        data.add("耳机")
        data.add("春夏秋冬超帅装")
        data.add("男装")
        data.add("女装")
        binding.flowLayout.setTextList(data)
    }
}